﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Framework.ContentWorkflow;

namespace Framework.WebSite
{
    public partial class SubscriberPage : System.Web.UI.Page
    {
        static bool hasSubscribed = false;
        static SubscriberPage()
        {
            
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!hasSubscribed)
                {
                    CMSEventsAggregator.Current.Subscribe<string>(
                        (o, er) =>
                        {
                            MessageTextBox.Text = er.Value;
                            //HttpContext.Current.Response.Redirect("~/SubscriberPage.aspx?v=" + er.Value);
                        }
                        );
                    hasSubscribed = true;
                }
                MessageTextBox.Text = Request["v"];
            }
        }
    }
}